/**
 * @file 权限管理
 * @author lishaohai
 */
import request from '@/utils/request';

// 系统管理 => 接口管理
export function getApiList(params) {
    return request({method: 'get', url: '/api/apis/', params});
}
export function postApiList(data) {
    return request({method: 'post', url: '/api/apis/', data});
}
// 批量添加列表
export function postApisList(data) {
    return request({method: 'post', url: '/api/apis/list/', data});
}
// 批量更新列表
export function putApisList(data) {
    return request({method: 'put', url: '/api/apis/', data});
}
// 单个更新列表
export function putApiList(id, data) {
    return request({method: 'put', url: `/api/apis/${id}/`, data});
}
export function getApiById(id) {
    return request({method: 'get', url: `/api/apis/${id}/`});
}
export function deleteApiById(id) {
    return request({method: 'delete', url: `/api/apis/${id}/`});
}
export function deleteApiByIds(ids) {
    return request({method: 'delete', url: '/api/apis/', data: ids});
}

// 系统管理 => 一级模块
export function getLayoutModules(params) {
    return request({method: 'get', url: '/api/layoutmodules/', params});
}

export function postLayoutModules(data) {
    return request({method: 'post', url: '/api/layoutmodules/', data});
}
export function postLayoutModulesList(data) {
    return request({method: 'post', url: '/api/layoutmodules/list/', data});
}

export function putLayoutModulesList(data) {
    return request({method: 'put', url: '/api/layoutmodules/', data});
}
export function putLayoutModules(id, data) {
    return request({method: 'put', url: `/api/layoutmodules/${id}/`, data});
}

export function getLayoutModuleById(id) {
    return request({method: 'get', url: `/api/layoutmodules/${id}/`});
}
export function deleteLayoutModuleById(id) {
    return request({method: 'delete', url: `/api/layoutmodules/${id}/`});
}
export function deleteLayoutModuleByIds(ids) {
    return request({method: 'delete', url: '/api/layoutmodules/', data: ids});
}
// 系统管理 => 一级模块
export function getParentModules(params) {
    return request({method: 'get', url: '/api/parentmodules/', params});
}

export function postParentModules(data) {
    return request({method: 'post', url: '/api/parentmodules/', data});
}

export function putParentModules(id, data) {
    return request({method: 'put', url: `/api/parentmodules/${id}/`, data});
}

export function getParentModuleById(id) {
    return request({method: 'get', url: `/api/parentmodules/${id}/`});
}
export function deleteParentModuleById(id) {
    return request({method: 'delete', url: `/api/parentmodules/${id}/`});
}

// 系统管理 => 二级模块
export function getChildModules(params) {
    return request({method: 'get', url: '/api/childmodules/', params});
}

export function postChildModules(data) {
    return request({method: 'post', url: '/api/childmodules/', data});
}

export function putChildModules(id, data) {
    return request({method: 'put', url: `/api/childmodules/${id}/`, data});
}

export function getChildModuleById(id) {
    return request({method: 'get', url: `/api/childmodules/${id}/`});
}
export function deleteChildModuleById(id) {
    return request({method: 'delete', url: `/api/childmodules/${id}/`});
}

// 系统管理 => 功能模块
export function getFunctionMaps(params) {
    return request({method: 'get', url: '/api/functionmaps/', params});
}

export function postFunctionMaps(data) {
    return request({method: 'post', url: '/api/functionmaps/', data});
}
// 批量添加列表
export function postFunctionsMaps(data) {
    return request({method: 'post', url: '/api/functionmaps/list/', data});
}
// 批量更新列表
export function putFunctionsMaps(data) {
    return request({method: 'put', url: '/api/functionmaps/', data});
}
export function putFunctionMaps(id, data) {
    return request({method: 'put', url: `/api/functionmaps/${id}/`, data});
}

export function getFunctionMapById(id) {
    return request({method: 'get', url: `/api/functionmaps/${id}/`});
}
export function deleteFunctionMapById(id) {
    return request({method: 'delete', url: `/api/functionmaps/${id}/`});
}
export function deleteFunctionMapByIds(ids) {
    return request({method: 'delete', url: '/api/functionmaps/', data: ids});
}
